projects
/
project
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd7a2d4
)
dhcpv4: generate dbus events on lease expiry
author
David Härdeman
<
[email protected]
>
Tue, 7 Oct 2025 12:16:11 +0000
(14:16 +0200)
committer
Álvaro Fernández Rojas
<
[email protected]
>
Thu, 9 Oct 2025 06:49:04 +0000
(08:49 +0200)
We already generate events when a lease is acquired and released, so it seems
consistent to also generate events when a lease expires.
Signed-off-by: David Härdeman <
[email protected]
>
Link:
https://github.com/openwrt/odhcpd/pull/270
Signed-off-by: Álvaro Fernández Rojas <
[email protected]
>
src/dhcpv4.c
patch
|
blob
|
history
diff --git
a/src/dhcpv4.c
b/src/dhcpv4.c
index 45a6469a1930cdc281bb6779f11ac67b8440b13a..bdcd8e8add0ee33e7cbf9361845ac6b046c1843c 100644
(file)
--- a/
src/dhcpv4.c
+++ b/
src/dhcpv4.c
@@
-1192,8
+1192,12
@@
static void dhcpv4_valid_until_cb(struct uloop_timeout *event)
continue;
list_for_each_entry_safe(a, n, &iface->dhcpv4_assignments, head) {
- if (!INFINITE_VALID(a->valid_until) && a->valid_until < now)
+ if (!INFINITE_VALID(a->valid_until) && a->valid_until < now) {
+ ubus_bcast_dhcp_event("dhcp.expire", a->hwaddr,
+ (struct in_addr *)&a->addr,
+ a->hostname, iface->ifname);
free_assignment(a);
+ }
}
}
uloop_timeout_set(event, 1000);